import java.util.ArrayList;

public class BadugiKarta implements Comparable<BadugiKarta> 
{
	BadugiFigura figura;
	BadugiKolor kolor;
	
	public BadugiKarta(BadugiFigura f, BadugiKolor k)
	{
		figura = f;
		kolor = k;
	}

	public String toString()
	{
		String nazwaFigury = figura.name();
		String nazwaKoloru = kolor.name();
		nazwaFigury = nazwaFigury.replaceFirst("f", "");
		return capitalize(nazwaFigury).concat(capitalize(nazwaKoloru));
	}
	
	private String capitalize(String line)
	{
		return Character.toUpperCase(line.charAt(0)) + line.substring(1);
	}
	
	@Override
	public int compareTo(BadugiKarta drugaKarta) 
	{
		return figura.compareTo(drugaKarta.figura);
	}
	
	static String pobierzListeKart(ArrayList <BadugiKarta> karty)
	{
		StringBuilder sb = new StringBuilder();
		for (BadugiKarta k : karty) 
		{
			sb.append(k).append(" | ");
		}
		return sb.toString();
	}
	
}
